#!/usr/bin/env bash

# set -x
set -e

_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

proj=bladebit
builds=builds

function sync_proj()
{
    plat=$1
    
    echo "syncing make & vscode $plat" >&2
    mkdir -p "$builds/$plat"
    
    psync -t make   $proj "$plat" "$builds/$plat"
    psync -t vscode $proj "$plat" $_dir
}

sync_proj win32
sync_proj linux
sync_proj macos
# sync_proj web

echo "syncing visual studio win32"
psync -t vs $proj win32 "$_dir/${proj}.vcxproj"

echo "All synced."
exit 0